
from django.db import models



# 设置自关联表关系
class AreaModles(models.Model):
    area_name = models.CharField(max_length=20)
    parent = models.ForeignKey('self',  on_delete=models.SET_NULL , null=True,blank=True,related_name='subs' )


    class Meta:
        db_table = 'areas'